const { StackTracer } = require("./StackTracer");

// input folders
const sourcemapFolder = require('path').resolve(__dirname, 'sourcemap');
const namecacheFolder = require('path').resolve(__dirname, 'namecache');
const libFolder = undefined;

// input one line
const line = '';
// input multi lines
const lines = [];

(async function test() { 
    console.log('StackTracer test start......\n');
    const stackTracer = new StackTracer(sourcemapFolder, namecacheFolder, libFolder);
    await stackTracer.init();
    {
        console.log('\n\nparseOneLine:');
        let res = await stackTracer.parseOneLine(line);
        console.log(res);
    }
    {
        console.log('\n\nparseMultiLines:');
        let res = await stackTracer.parseMultiLines(lines)
        console.log(res.join('\n'));
    }
    await stackTracer.unInit();
    console.log('StackTracer test end.\n');
}) ();